<?
include("../lib/config.php");
$nik 	= $HTTP_GET_VARS['nik'];
$op		= $HTTP_GET_VARS['op'];
$no		= $HTTP_GET_VARS['no'];

if($op == "edit"){
	$Faction = "../lib/update.php";
	$Vbutton = "Update";
	$query	= mssql_query("WITH limit as (SELECT ROW_NUMBER() OVER (ORDER BY NIK) as No, kode, nama FROM Bahasa A, VBahasa B WHERE nik='$nik' and A.Bahasa=B.kode) Select * from limit where No='$no'",$conn);
	$row	= mssql_fetch_array($query);
}
else{
	$Faction = "../lib/save.php";
	$Vbutton = "Simpan";
}

include("../header.php");
?>
<script type="text/javascript" language="javascript">
	function Validate(){
		/*if(document.FEmployee.nik.value == "")
		{
			alert("Field : NIK tidak boleh kosong ...");
			document.FEmployee.nik.focus();
			return false;
		}
*/
		if(document.FEmployee.bahasa.value == "")
		{
			alert("Field : Bahasa tidak boleh kosong ...");
			document.FEmployee.bahasa.focus();
			return false;
		}
/*
		if(document.FEmployee.status.value == "")
		{
			alert("Field : Status tidak boleh kosong ...");
			document.FEmployee.status.focus();
			return false;
		}
*/		
		document.FEmployee.submit();

	}
	
	/*
	function show_popup()
	{
		child = open
		(
			"../form/frm_list_emp.php",
			"",
			"scrollbars=no,width=400,height=450,left=150,top=150"
		);
	}
	
	function on_top()
	{
		if (child != null)
			if (child.closed)
				child = null;
			else
				child.focus();
				else
				{
				
				}
	}*/
</script>
</head>
<form name="FEmployee" method="post" action="<?=$Faction?>">
<table width="100%" class="no_border">
 <tr>
  <td colspan="2">
	<table width="100%" style="border:none;">
	<tr>
	 <td colspan="2" class="line_bottom">&nbsp;&nbsp;<b>Data Kecakapan</td>
	</tr>
	<tr>
	 <tr>
	  <td>&nbsp;</td>
	 <td align="right" class="line_bottom">
	 <a href="../lib/detailemp.php?show=pribadi&amp;nik=<?=$nik?>">Data Pribadi</a> &raquo; 
	 <a href="../lib/detailemp.php?show=data_umum&amp;nik=<?=$nik?>">Data Umum</a> &raquo; 
	 <a href="../lib/detailemp.php?show=pendidikan&amp;nik=<?=$nik?>">Pendidikan</a> &raquo; 
	 <a href="../lib/detailemp.php?show=kecakapan&amp;nik=<?=$nik?>"><b>Kecakapan</b></a> &raquo; 
	 <a href="../lib/detailemp.php?show=keluarga&amp;nik=<?=$nik?>">Keluarga</a> &raquo; 
	 <a href="../lib/detailemp.php?show=karir&amp;nik=<?=$nik?>">Pengalaman</a> &raquo; 
	 <a href="../lib/detailemp.php?show=organisasi&amp;nik=<?=$nik?>">Organisasi</a> 
	 </td>
	 </tr>
	</table>
  </td>
  </td>
 </tr>
 <tr>
  <td>&nbsp;</td>
 </tr>
 <tr>
  <td>
 <table cellpadding="0" cellspacing="0">
 <tr>
  <td width="200">&nbsp;&nbsp;&nbsp;Bahasa yang dikuasai</td>
  <td>: 
  <select name="bahasa">
  <?
   echo"<option value='".$row[kode]."'>".$row[nama]."</option>";
   echo"<option value=''>-select-</option></a>";
  // sql bahasa
  $sql3 = mssql_query("SELECT * FROM VBahasa",$conn);
  while($row3 = mssql_fetch_array($sql3)){
  	echo"<option value='$row3[kode]'>$row3[nama]</option>";
  }
  ?>
  </select>
  <span class="required">*</span></td>
 </tr>
 <!--
 <tr>
  <td>Status</td>
  <td>: 
   <select name="status">
    <option value="">-Pilih-</option>
	<option value="aktif">Aktif</option>
	<option value="pasif">Pasif</option>
   </select> <span class="required">*</span>
  </td>
 </tr>
 -->
 <tr>
  <td>&nbsp;</td>
  <td align="left"><br /><br />
  <input type="hidden" name="nik" value="<?=$nik?>" />
  <input type="hidden" name="cat" value="bahasa" />
  <input type="hidden" name="no" value="<?=$row[No]?>" />
  <input type="reset" value="Batal" class="button"/><input type="button" value="<?=$Vbutton?>" class="button" onClick="Validate();" />
  <br /><br />
  </td>
 </tr>
</table>
</form>
</td>
</tr>
<tr>
 <td colspan="2" style="border:none;"><? include("../footer.php"); ?></td>
</tr>
</table>
<?
echo"</div>
	  </td>
	   </tr>
	    </table>
";
include("../menu.php");
?>
